package com.test.service.impl;

import java.util.List;

import com.test.dao.UserDao;
import com.test.domain.User;
import com.test.service.UserService;

public class UserServiceImpl implements UserService {
	//从容器中获得dao实例
	private UserDao userDao;
	
	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	/**
	 * 实现分页查询
	 */
	public List<User> SearchUser(User user, int firstResult, int maxResults) {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean addUser(User user) {
		// TODO Auto-generated method stub
		return userDao.add(user);
	}

	public boolean deleteUser(Integer id) {
		// TODO Auto-generated method stub
		return userDao.delete(id);
	}

	public List<User> findAll() {
		// TODO Auto-generated method stub
		return userDao.findAll();
	}

	public User findUserById(Integer id) {
		// TODO Auto-generated method stub
		return userDao.getById(id);
	}

	public boolean updateUser(User user) {
		// TODO Auto-generated method stub
		return userDao.update(user);
	}

	public User findLoginUser(String loginName, String password) {
		return userDao.getLoginUser(loginName, password);
	}

}
